#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2e5 + 5;

ll n, m, d, e;
void solve() {
  cin >> n >> d >> e;
  m = n - d * e + 2;
  ll delta = m * m - 4 * n;
  ll x = round(sqrt(delta));
  if (x * x != delta || m % 2 != x % 2) {
    cout << "NO" << endl;
    return;
  }
  ll p = (m - x) / 2, q = (m + x) / 2;
  cout << p << ' ' << q << endl;
}

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}